<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<%@ taglib prefix="sec" uri="/WEB-INF/tags/shiro.tld"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>业务参数配置</title>
<base href="<%=ViewUtil.getRequestPath(request)%>">
<%@page
	import="avicit.platform6.api.sysshirolog.impl.AfterLoginSessionProcess"%>
<%
	Object lang = session
			.getAttribute(AfterLoginSessionProcess.SESSION_CURRENT_LANGUAGE_CODE);
	String languageCode = "zh_CN";
	if (lang != null) {
		languageCode = lang.toString();
	}
	Locale locale = SessionHelper.getLocaleByUser(request);
%>
<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">
<jsp:include
	page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<script type="text/javascript"
	src="avicit/im/lantop/basic/useconfig/locale/language_<%=languageCode%>.js"></script>
<script type="text/javascript">
//自定义验证规则
$.extend($.fn.validatebox.defaults.rules,{
	length:{validator: function (value,param){
		var len = $.trim(value).length;
		return len >= param[0] && len <= param[1];
	},
		//"只能输入长度必须介于{0}和{1}之间."
		message:"<%=PlatformLocalesJSTL.getBundleValue(
					"lantop.basicdatamanager.useconfig.content", "i18n.lantop",
					locale)%>{0}<%=PlatformLocalesJSTL.getBundleValue(
					"lantop.basicdatamanager.useconfig.content2",
					"i18n.lantop", locale)%>{1}<%=PlatformLocalesJSTL.getBundleValue(
					"lantop.basicdatamanager.useconfig.content3",
					"i18n.lantop", locale)%>"
	},
	integer:{
		validator:function (value){
			return /^[+]?[1-9]+\d*$/i.test(value);
	},
		//"只能输入大于0的整数值"
		message:"<%=PlatformLocalesJSTL.getBundleValue(
					"lantop.basicdatamanager.useconfig.content4",
					"i18n.lantop", locale)%>"
	},
	email:{
		validator:function(value){
			return /^[a-zA-Z0-9_-]+[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/i.test(value);
	},
		//"请输入正确的服务器地址"
		message:"<%=PlatformLocalesJSTL.getBundleValue(
					"lantop.basicdatamanager.useconfig.content5",
					"i18n.lantop", locale)%>"
	}
});

/**
 * 合并单元格
 */
function mergeCell() {
	//获取系统通用代码类型为“CBB_SECRET”的密级个数
	$.ajax({
		url: 'platform/UseConfigController/getCbbSecretNum',
		type: 'post',
		dataType: 'json',
		success: function(result){
			var secretNum = result.secretNum;
			var useTypeNum = result.useTypeNum;
			for(var i = 0; i < secretNum; i++){
				$('#myOrderDataGrid').datagrid('mergeCells',{
			        index: i * useTypeNum,
			        field: 'SECRET_NAME',
			        rowspan: useTypeNum
			    });
			}
		}
	});
}
</script>
<script type="text/javascript"
	src="avicit/im/lantop/basic/useconfig/UseConfigManager.js"></script>
<style>
	body{
		font-family:微软雅黑;
	}
	
	table{
		width:100%;
	}
	table input{
		width:90%;
		background:white;
		border:1px solid #dedede;
		border-radius:3px;
		height:23px !important;
		line-height:23px;
		padding-left:10px;
	}
	
</style>
</head>
<body>
	<div data-options="region:'north'" style="height: 40px;margin-top:10px;">
		<div id="toolbar"
			 style="border-bottom:1px solid #dedede;padding-bottom:10px;">
			<!-- 隐藏配置数据ID -->
			<input id="dataId" type="hidden" />
			<table border="0" cellspacing="1" width="100%">
				<tr>
					<td align="left"><sec:accesscontrollist hasPermission="3"
							domainObject="useconfigmanager_UseConfigManager_button_saveData">
							<%-- 编辑 --%>
							<a class="selbtn easyui-linkbutton" id="resetButton"
								onclick="editDatas()">
								<img src="avicit/im/lantop/common/search/image/icon_tool30_blue.png"><span class="selbtc">编辑</span></a>
						</sec:accesscontrollist>
					</td>
					<td align="right">

					</td>
				</tr>
			</table>
		</div>
	</div>
	<div data-options="region:'center' height: auto;" style="overflow: hidden;">
		<form id="configForm">
			<div style="padding: 10px; margin: 18px;">
				<table>
					<%-- 档案鉴定 --%>
					<!-- <tr>
						<th colspan=1><span style="font-size: 14px;">档案鉴定</span></th>
					</tr> -->
					<tr>
						<td colspan=1 width="10%" align="center">
							<img src="avicit/im/lantop/common/search/image/icon_tool790_blue.png" style="display:block;margin:0 auto 10px;">
							<span style="font-size: 14px; color:#4a4a4a">档案鉴定</span>
						</td>

						<td colspan=2 width="10%" align="right"><span style="margin-right:5px;">鉴定预提醒天数</span></td>
						
						<%-- 
					     在data-options追加required:true使用逗号分隔，鉴定为必填字段
					  validType:['length[1,3]','integer']长度类型校验
					 --%>
						<td width="25%"><input class="easyui-validatebox"
							data-options="min:0" type="text" id="appointmentArsDays"
							name="appointmentArsDays"
							onkeyup="this.value=this.value.replace(/[^\d]/g,'')" value="10"
							disabled="disabled" style="color: #585858" /></td>
						<th></th>
					</tr>
				</table>
			</div>
			<div style="width:99%; border-bottom:1px solid #dedede;"></div>
			<div style="padding: 10px; margin: 18px;">
				<table style="border-collapse:separate; border-spacing:0px 10px;">
					<%-- 电子档案 --%>
					<tr>
						<td rowspan=5 width="10%;" align="center">
						<img src="avicit/im/lantop/common/search/image/icon_tool791_blue.png" style="display:block;margin:0 auto 10px;">
						<span style="font-size: 14px; color:#4a4a4a;">电子档案</span></td>
					</tr>
					<tr>
						<td width="10%"></th>
						<td width="25%" align="center">可利用天数</td>
						<td width="25%" align="center">可续借天数</td>
						<td></th>
					</tr>
					<tr>
						<td colspan=1 align="right"><span style="margin-right:5px;">下载</span></td>
						<td><input data-options="min:0" value="10"
							disabled="disabled" class="easyui-validatebox" type="text"
							id="download_defaultUseDays" name="defaultUseDays"
							onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858" /></td>
						<td><input data-options="min:0" value="10"
							disabled="disabled" class="easyui-validatebox" type="text"
							id="download_defaultBorrowDays"  name="defaultBorrowDays"
							onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
						<th></th>
					</tr>
					<tr>
						<td colspan=1 width="10%" align="right"><span style="margin-right:5px;">打印</span></td>
						<td><input data-options="min:0" value="10"
							disabled="disabled" class="easyui-validatebox" type="text"
							id="printing_defaultUseDays" name="defaultUseDays"
							onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858" /></td>
						<td><input data-options="min:0" value="10"
							disabled="disabled" class="easyui-validatebox" type="text"
							id="printing_defaultBorrowDays" name="defaultBorrowDays"
							onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858" /></td>
						<th></th>
					</tr>
					<tr>
						<td colspan=1 width="10%" align="right"><span style="margin-right:5px;">浏览</span></td>
						<td><input data-options="min:0" value="10"
							disabled="disabled" class="easyui-validatebox" type="text"
							id="browse_defaultUseDays" name="defaultUseDays"
							onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
						<td><input data-options="min:0" value="10"
							disabled="disabled" class="easyui-validatebox" type="text"
							id="browse_defaultBorrowDays" name="defaultBorrowDays"
							onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
						<th></th>
					</tr>
				</table>
			</div>
			<div style="width:99%; border-bottom:1px solid #dedede;"></div>
			<div style="padding: 10px; margin: 18px;height: 220px;">
				<table style="border-collapse:separate; border-spacing:0px 10px;">
					<%-- 纸质档案 --%>
					<tr>
						<td rowspan=6 width="10%"align="center">
							<img src="avicit/im/lantop/common/search/image/icon_tool792_blue.png" style="display:block;margin:0 auto 10px;">
							<span style="font-size: 14px;color:#4a4a4a;">纸质档案</span>
						</td>
					</tr>
					<tr>
						<td width="10%"></td>
						<td width="25%" align="center">可利用天数</td>
						<td width="25%" align="center">可续借天数</td>
						<td width="25%" align="center">提前催还天数</td>
						<td></td>
					</tr>
					<tr>
						<td align="right"><span style="margin-right:5px;">借阅</span></td>
						<td><input data-options="min:0" value="10"
							disabled="disabled" class="easyui-validatebox" type="text"
							id="borrowing_defaultUseDays" name="defaultUseDays"style="color: #585858"/></td>
						<td><input data-options="min:0" value="10"
							disabled="disabled" class="easyui-validatebox" type="text"
							id="borrowing_defaultBorrowDays" name="defaultBorrowDays"
							onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
						<td><input data-options="min:0" value="10"
							disabled="disabled" class="easyui-validatebox" type="text"
							id="borrowing_defaultUrgeDays" name="defaultUrgeDays"
							onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
						<th></th>
					</tr>
						<tr>
						
							<td align="right"><span style="margin-right:5px;">浏览(无水印)</span></td>
							<td><input data-options="min:0" value="10"
									   disabled="disabled" class="easyui-validatebox" type="text"
									   id="borrowingNoWatermark_defaultUseDays" name="defaultUseDays"style="color: #585858"/></td>
							<td><input data-options="min:0" value="10"
									   disabled="disabled" class="easyui-validatebox" type="text"
									   id="borrowingNoWatermark_defaultBorrowDays" name="defaultBorrowDays"
									   onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
							<td><input data-options="min:0" value="10"
									   disabled="disabled" class="easyui-validatebox" type="text"
									   id="borrowingNoWatermark_defaultUrgeDays" name="defaultUrgeDays"
									   onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
							<th></th>
						</tr>
						<tr>
						
							<td align="right"><span style="margin-right:5px;">下载(无水印)</span></td>
							<td><input data-options="min:0" value="10"
									   disabled="disabled" class="easyui-validatebox" type="text"
									   id="downloadNoWatermark_defaultUseDays" name="defaultUseDays"style="color: #585858"/></td>
							<td><input data-options="min:0" value="10"
									   disabled="disabled" class="easyui-validatebox" type="text"
									   id="downloadNoWatermark_defaultBorrowDays" name="defaultBorrowDays"
									   onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
							<td><input data-options="min:0" value="10"
									   disabled="disabled" class="easyui-validatebox" type="text"
									   id="downloadNoWatermark_defaultUrgeDays" name="defaultUrgeDays"
									   onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
							<th></th>
						</tr>
						<tr>
					
							<td align="right"><span style="margin-right:5px;">纸质原件</span></td>
							<td><input data-options="min:0" value="10"
									   disabled="disabled" class="easyui-validatebox" type="text"
									   id="downloadPaper_defaultUseDays" name="defaultUseDays"style="color: #585858"/></td>
							<td><input data-options="min:0" value="10"
									   disabled="disabled" class="easyui-validatebox" type="text"
									   id="downloadPaper_defaultBorrowDays" name="defaultBorrowDays"
									   onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
							<td><input data-options="min:0" value="10"
									   disabled="disabled" class="easyui-validatebox" type="text"
									   id="downloadPaper_defaultUrgeDays" name="defaultUrgeDays"
									   onkeyup="this.value=this.value.replace(/[^\d]/g,'')" style="color: #585858"/></td>
							<th></th>
						</tr>
				</table>
			</div>
		</form>
	</div>
	<div style="text-align: center;width: 100%;position:fixed;bottom: 0;background:white;padding: 10px;box-sizing:border-box;">
			<sec:accesscontrollist hasPermission="3"
								   domainObject="useconfigmanager_UseConfigManager_button_saveData">
				<%-- 保存 --%>
				<a class="selbtn easyui-linkbutton" id="saveButto" style="margin-right:20px;"
				   onclick="saveData()" href="javascript:void(0);">
					<img src="avicit/im/lantop/common/search/image/icon_tool10_blue.png"><span class="selbtc"><%=PlatformLocalesJSTL.getBundleValue(
						"lantop.basicdatamanager.useconfig.button.save",
						"i18n.lantop", locale)%></span></a>
			</sec:accesscontrollist> <sec:accesscontrollist hasPermission="3"
															domainObject="useconfigmanager_UseConfigManager_button_resetData">
			<%-- 重置 --%>
			<a style="margin-right:15px;" class="selbtn easyui-linkbutton" id="resetButto"
			   onclick="javascript:history.go();" >
				<img src="avicit/im/lantop/common/search/image/icon_tool42_blue.png"><span class="selbtc">返回</span></a>
		</sec:accesscontrollist>
	</div>
	<script type="text/javascript">
		sysId = "<%=request.getParameter("sysId")%>";
		// 新的页面初始化加载数据方法 create by zhaoxiaolong date:2019/07/02
		$(function(){
			$.ajax({
				// 初始化页面数据
				url : 'platform/UseConfigController/selectUserConfig',
				data : {
					sysId : sysId
				},
				type : 'post',
				dataType : 'json',
				success : function(result) {
					if(result.result[0].flag=='2'){
						flag=result.result[0].flag;
					}else{ // 获取天数数据，显示至页面
						$('#appointmentArsDays').val(result.result[0].appointmentArsDays);
						$('#download_defaultUseDays').val(result.result[0].download_defaultUseDays);
						$("#download_defaultBorrowDays").val(result.result[0].download_defaultBorrowDays);
						$("#printing_defaultUseDays").val(result.result[0].printing_defaultUseDays);
						$("#printing_defaultBorrowDays").val(result.result[0].printing_defaultBorrowDays);
						$("#browse_defaultUseDays").val(result.result[0].browse_defaultUseDays);
						$("#browse_defaultBorrowDays").val(result.result[0].browse_defaultBorrowDays);
						$("#borrowing_defaultUseDays").val(result.result[0].borrowing_defaultUseDays);
						$("#borrowing_defaultBorrowDays").val(result.result[0].borrowing_defaultBorrowDays);
						$("#borrowing_defaultUrgeDays").val(result.result[0].borrowing_defaultUrgeDays);

						$("#borrowingNoWatermark_defaultUseDays").val(result.result[0].borrowingNoWatermark_defaultUseDays);
						$("#borrowingNoWatermark_defaultBorrowDays").val(result.result[0].borrowingNoWatermark_defaultBorrowDays);
						$("#borrowingNoWatermark_defaultUrgeDays").val(result.result[0].borrowingNoWatermark_defaultUrgeDays);
						$("#downloadNoWatermark_defaultUseDays").val(result.result[0].downloadNoWatermark_defaultUseDays);
						$("#downloadNoWatermark_defaultBorrowDays").val(result.result[0].downloadNoWatermark_defaultBorrowDays);
						$("#downloadNoWatermark_defaultUrgeDays").val(result.result[0].downloadNoWatermark_defaultUrgeDays);
						$("#downloadPaper_defaultUseDays").val(result.result[0].downloadPaper_defaultUseDays);
						$("#downloadPaper_defaultBorrowDays").val(result.result[0].downloadPaper_defaultBorrowDays);
						$("#downloadPaper_defaultUrgeDays").val(result.result[0].downloadPaper_defaultUrgeDays);

						flag=result.result[0].flag;
					}
				}
			});
		});
	</script>
</body>
<script type="text/javascript" src="static/js/platform/index/js/divscroll.js" ></script>
<script>
	$(function(){
		$("body").perfectScrollbar();
	});
</script>
</html>
